//入口文件

import React from 'react'

import { HashRouter as Router, Route, Link, Switch } from "react-router-dom";

import About from './../route1/About'
import Topics from './../route1/Topic'
import Main from './Main'

// 引入 Link 标签的组件，然后嵌套在url 地址栏显示的路由 Route
import Home from './Home'

class RouterI extends React.Component {
    render() {
        return (
            <Router>
                <Home>
                    {/* 嵌套路由 一定要把component 变成一个 render */}
                    <Route path="/main" render={() => 
                       <Main>
                           <Route path="/main/a" component={About} />
                       </Main> 
                    } />
                    <Route path="/about" component={About} />
                    <Route path="/topics" component={Topics} />   
                </Home>
            </Router>
        )
    }
}


export default RouterI